<html xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>outputScript
          (JSF 2.1 View Declaration Language: Facelets Variant)
        </title>
<meta name="keywords" content="$title">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<script>
            function asd()
            {
            parent.document.title="outputScript (JSF 2.1 View Declaration Language: Facelets Variant)";
            }
          </script>
<body bgcolor="white" onload="asd();">
<a name="navbar_top"></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td COLSPAN="3" BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><a NAME="navbar_top_firstrow"></a>
<table BORDER="0" CELLPADDING="0" CELLSPACING="3">
<tr ALIGN="center" VALIGN="top">
<td BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    &nbsp;<a href="../overview-summary.html"><font CLASS="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td><td BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    &nbsp;<a href="tld-summary.html"><font CLASS="NavBarFont1"><b>Library</b></font></a>&nbsp;</td><td BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<font CLASS="NavBarFont1Rev">&nbsp;Tag&nbsp;</font>&nbsp;</td><td BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    &nbsp;<a HREF="../help-doc.html"><font CLASS="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
</tr>
</table>
</td><td ALIGN="right" VALIGN="top" ROWSPAN="3"><em></em></td>
</tr>
<tr>
<td BGCOLOR="white" CLASS="NavBarCell2"><font SIZE="-2"></font></td><td BGCOLOR="white" CLASS="NavBarCell2"><font SIZE="-2">
                &nbsp;<a HREF="../index.html" TARGET="_top"><b>FRAMES</b></a>&nbsp;
                &nbsp;<a href="outputScript.html" target="_top"><b>NO FRAMES</b></a>&nbsp;
                <script></script>
<noscript>
<a HREF="../alltags-noframe.html" TARGET=""><b>All Tags</b></a>
</noscript>
</font></td>
</tr>
</table>
<hr>
<h2>
<font size="-1">h</font>
<br>
            Tag outputScript</h2>
<hr><p class="changed_modified_2_0"><span class="changed_modified_2_0_rev_a changed_modified_2_1">Render</span> the markup for a <code>&lt;script&gt;</code> element that renders the script <code>Resource</code> specified by the optional <code>name</code> attribute and <code>library</code> attributes.</p> <p class="changed_modified_2_0">The implementation of this renderer must have a <a target="_" href="../../javadocs/javax/faces/event/ListenerFor.html"><code>@ListenerFor</code></a> annotation attached to it, at the class level, declaring <a target="_" href="../../javadocs/javax/faces/event/PostAddToViewEvent.html"><code>PostAddToViewEvent.class</code></a> as the value of the <code>systemEventClass</code> attribute. The presence of this annotation on a renderer implies the renderer implements <a target="_" href="../../javadocs/javax/faces/event/ComponentSystemEventListener.html"><code>ComponentSystemEventListener</code></a>, which this renderer must do. The implementation of <code>processEvent()</code> must extract the <code>UIComponent</code> from the argument event and look for the presence of the key "<code>target</code>" in the component's attribute <code>Map</code>. If and only if such a key is present, the implementation of <code>processEvent()</code> must pass the component to <a target="_" href="../../javadocs/javax/faces/component/UIViewRoot.html#addComponentResource(javax.faces.context.FacesContext,%20javax.faces.component.UIComponent)"><code>UIViewRoot.addComponentResource()</code></a>.</p> <p class="changed_modified_2_0">Decode Behavior</p> <ul class="changed_modified_2_0"> <p>No action is required during decode for this renderer.</p> </ul> <p class="changed_modified_2_0">Encode Behavior</p> <ul class="changed_modified_2_0"> <p><a name="ResourceCommonGetResource">Common Algorithm for Obtaining A Resource to Render</a></p> <ul> <p>This algorithm is used by all resource renderers to obtain a <code>Resource</code> instance which is then rendered in a specific way depending on what kind of renderer is doing the encoding.</p> <ul> <li><p>Look in the component attribute <code>Map</code> for a value under the key <em>name</em>.</p></li> <li><p>Look in the component attribute <code>Map</code> for a value under the key <em>library</em>. This attribute is optional, therefore, <em>library</em> may be <code>null</code>.</p></li> <li><p>Create the resource by calling <code>Application.getResourceHandler.createResource(<em>name</em>, <em>library</em>);</code>.</p></li> </p></li> </ul> </ul> <p><a name="ResourceCommonEncode">Common Encode Behavior</a></p> <ul> <p>This algorithm is used by all resource renderers to render the resource.</p> <p><code>encodeBegin()</code> must take no action.</p> <p>Because this renderer returns <code>true</code> from <code>getRendersChildren()</code>, the <code>encodeChildren() method must take the following action.</code></p> <ul> <li><p>If there is no <em>name</em> attribute, and the argument <code>component</code> has no children, and <code>ProjectStage</code> is not <code>ProjectStage.Production</code>, add a <code>FacesMessage</code> for this component's clientId to the <code>FacesContext</code> stating that if no name attribute is present, and no body content is present either, then the user should take action to correct this problem. In this case, <code>encodeChildren()</code> must take no further action.</p></li> <li><p>If there is no <em>name</em> attribute and the argument <code>component</code> <b>does</b> have children, the renderer must ensure that those children are encoded as usual.</p></li> <li><p>If there <b>is</b> a <em>name</em> attribute and the argument <code>component</code> <b>does</b> have children, the renderer must log a descriptive localized message stating that the child content will be ignored. The resource referenced by the <em>name</em> attribute will be rendered in <code>encodeEnd()</code>.</p></li> <li><p>If there <b>is</b> a <em>name attribute</em> and the argument <code>component</code> <b>does not</b> have children, <code>encodeChildren()</code> must take no action.</p></li> </ul> <p><code>encodeEnd()</code> must take specific action based on the specific kind of resource being rendered.</p> </ul> <p>Use the algorithm <em>Common Encode Behavior</em> for <code>encodeBegin()</code>, <code>encodeChildren()</code> and <code>getRendersChildren()</code>.</p> <p>For <code>encodeEnd()</code>, use the algorithm <em>Common Algorithm for Obtaining A Resource to Render</em> above to obtain a reference to the <code>Resource</code> to be encoded.</p> <p>If this is NOT the first time this <code>Resource</code> has been referenced on this request take no action and return.</p> <p>Render a script element. <span class="changed_modified_2_1">Call <code>resource.getRequestPath()</code>. If the result contains a query string, take care to handle it correctly. Pass the request path to a call to <code>encodeResourceURL()</code> on the <code>ExternalContext</code>. Use the result as the value of the "src" attribute. Use the result from calling <code>resource.getContentType()</code> as the value of the "type" attribute.</span></p> </ul><br>
<p></p>
<hr>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan="2"><font size="+2"><b>Tag Information</b></font></td>
</tr>
<tr>
<td>Tag Class</td><td>.Outputresource.ScriptTag</td>
</tr>
<tr>
<td>TagExtraInfo Class</td><td><i>None</i></td>
</tr>
<tr>
<td>Body Content</td><td>JSP</td>
</tr>
<tr>
<td>Display Name</td><td><i>None</i></td>
</tr>
</table>
<br>
<p></p>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan="5"><font size="+2"><b>Attributes</b></font></td>
</tr>
<tr>
<td><b>Name</b></td><td><b>Required</b></td><td><b>Request-time</b></td><td><b>Type</b></td><td><b>Description</b></td>
</tr>
<tr valign="top">
<td>converter</td><td>false</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>javax.faces.convert.Converter</code>)
                    </td><td>Converter instance registered with this component.</td>
</tr>
<tr valign="top">
<td>id</td><td>false</td><td>true</td><td><code>java.lang.String</code></td><td>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</td>
</tr>
<tr valign="top">
<td>rendered</td><td>false</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>boolean</code>)
                    </td><td>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</td>
</tr>
<tr valign="top">
<td>value</td><td>false</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>java.lang.Object</code>)
                    </td><td>The current value of this component.</td>
</tr>
<tr valign="top">
<td>library</td><td>false</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>java.lang.String</code>)
                    </td><td><div class="changed_added_2_0"><p>The <em>libraryName</em> for this resource.</p></div></td>
</tr>
<tr valign="top">
<td>name</td><td>true</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>java.lang.String</code>)
                    </td><td><div class="changed_added_2_0"><p>The <em>resourceName</em> for this resource.</p></div><div class="changed_modified_2_0_rev_a"> <p>This attribute is required</p></div></td>
</tr>
<tr valign="top">
<td>target</td><td>false</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>java.lang.String</code>)
                    </td><td><div class="changed_added_2_0"><p>The <em>target</em> area for which this resource will be rendered. For example, <em>target="head"</em> would cause the resource to be rendered within the <em>head</em> element. <span class="changed_modified_2_0_rev_a">If no value is specififed, the script element is rendered at the same point in the view where the tag is located.</span> <span class="changed_modified_2_0_rev_a">Currently supported values for this attribute are "head", "body", and "form".</span></p></div></td>
</tr>
<tr valign="top">
<td>binding</td><td>false</td><td>false</td><td><code>javax.el.ValueExpression</code>
<br>(<i>must evaluate to </i><code>javax.faces.component.UIComponent</code>)
                    </td><td>The ValueExpression linking this component to a property in a backing bean</td>
</tr>
</table>
<br>
<p></p>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan="5"><font size="+2"><b>Variables</b></font></td>
</tr>
<td colspan="2"><i>No Variables Defined.</i></td>
</table>
<br>
<p></p>
<a name="navbar_bottom"></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td COLSPAN="3" BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><a NAME="navbar_bottom_firstrow"></a>
<table BORDER="0" CELLPADDING="0" CELLSPACING="3">
<tr ALIGN="center" VALIGN="top">
<td BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    &nbsp;<a href="../overview-summary.html"><font CLASS="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td><td BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    &nbsp;<a href="tld-summary.html"><font CLASS="NavBarFont1"><b>Library</b></font></a>&nbsp;</td><td BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<font CLASS="NavBarFont1Rev">&nbsp;Tag&nbsp;</font>&nbsp;</td><td BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    &nbsp;<a HREF="../help-doc.html"><font CLASS="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
</tr>
</table>
</td><td ALIGN="right" VALIGN="top" ROWSPAN="3"><em></em></td>
</tr>
<tr>
<td BGCOLOR="white" CLASS="NavBarCell2"><font SIZE="-2"></font></td><td BGCOLOR="white" CLASS="NavBarCell2"><font SIZE="-2">
                &nbsp;<a HREF="../index.html" TARGET="_top"><b>FRAMES</b></a>&nbsp;
                &nbsp;<a href="outputScript.html" target="_top"><b>NO FRAMES</b></a>&nbsp;
                <script></script>
<noscript>
<a HREF="../alltags-noframe.html" TARGET=""><b>All Tags</b></a>
</noscript>
</font></td>
</tr>
</table>
<hr>
<small><i>
            Output Generated by 
            <a href="http://taglibrarydoc.dev.java.net/" target="_blank">Tag Library Documentation Generator</a>.
            </i></small>
</body>
</html>
